﻿using Sunny.UI;
using OxyPlot;
using OxyPlot.Series;
using OxyPlot.WindowsForms;
using System;
using System.Windows.Forms;

namespace WinFormsMVP.View
{
    public partial class MainForm : UIForm
    {
        public MainForm()
        {
            InitializeComponent();
            InitPlot();
        }

        private void InitPlot()
        {
            var model = new PlotModel { Title = "脉宽时间谱 - 通道1" };

            var lineSeries = new LineSeries
            {
                MarkerType = MarkerType.Circle,
                MarkerSize = 3,
                MarkerStroke = OxyColors.Black
            };

            for (int i = 0; i <= 250; i += 10)
            {
                lineSeries.Points.Add(new DataPoint(i, Math.Sin(i * 0.05) * 20 + 30));
            }

            model.Series.Add(lineSeries);
            plotView.Model = model;
        }
    }
}
